package com.wcar.common.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @TableName tb_car_store
 */
@TableName(value ="tb_car_store")
@Data
public class CarStore implements Serializable {
    /**
     * 门店ID (外键，关联到门店表的ID字段)
     */
    @TableId(type = IdType.AUTO)
    private Integer storeId;


    private Integer carId;


    private String carNo;

    @TableField(exist = false)
    private String userName;
    @TableField(exist = false)
    private String phone;
    @TableField(exist = false)
    private String remark;
    @TableField(exist = false)
    private String createBy;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @TableField(exist = false)
    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 门店ID (外键，关联到门店表的ID字段)
     */
    public Integer getStoreId() {
        return storeId;
    }

    /**
     * 门店ID (外键，关联到门店表的ID字段)
     */
    public void setStoreId(Integer storeId) {
        this.storeId = storeId;
    }

    /**
     * 车辆ID (外键，关联到车辆表的ID字段)
     */
    public Integer getCarId() {
        return carId;
    }

    /**
     * 车辆ID (外键，关联到车辆表的ID字段)
     */
    public void setCarId(Integer carId) {
        this.carId = carId;
    }

    /**
     * 
     */
    public String getCarNo() {
        return carNo;
    }

    /**
     * 
     */
    public void setCarNo(String carNo) {
        this.carNo = carNo;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        CarStore other = (CarStore) that;
        return (this.getStoreId() == null ? other.getStoreId() == null : this.getStoreId().equals(other.getStoreId()))
            && (this.getCarId() == null ? other.getCarId() == null : this.getCarId().equals(other.getCarId()))
            && (this.getCarNo() == null ? other.getCarNo() == null : this.getCarNo().equals(other.getCarNo()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getStoreId() == null) ? 0 : getStoreId().hashCode());
        result = prime * result + ((getCarId() == null) ? 0 : getCarId().hashCode());
        result = prime * result + ((getCarNo() == null) ? 0 : getCarNo().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", storeId=").append(storeId);
        sb.append(", carId=").append(carId);
        sb.append(", carNo=").append(carNo);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}